﻿using Module.Test.Domain.Validations.Customs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Module.Test.Domain.Commands.Customs
{
    public class RegisterCustomCommand : CustomCommand
    {
        //public RegisterCustomCommand() { }
        public RegisterCustomCommand(long id, string name
            //, DateTime createdTime
            )
        {
            this.Id = id;
            this.Name = name;
            //this.CreatedTime = CreatedTime;
        }

        // 重写基类中的 是否有效 方法
        // 主要是为了引入命令验证 RegisterCustomCommandValidation。
        public override bool IsValid()
        {
            ValidationResult = new RegisterCustomCommandValidation().Validate(this);
            return ValidationResult.IsValid;
        }
    }
}
